package br.com.kmproaudio.model.core;

public class Connection {
//	Connection conn = null;
//	Statement st = null;
//	ResultSet rs = null;
//	StringBuffer sb = new StringBuffer();
//	try {
//		InitialContext ctx = new InitialContext();
//		DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/TestDB");
//
//		// This works too
//		// Context envCtx = (Context) ctx.lookup("java:comp/env");
//		// DataSource ds = (DataSource) envCtx.lookup("jdbc/TestDB");
//
//		conn = ds.getConnection();
//
//		st = conn.createStatement();
//		rs = st.executeQuery("SELECT * FROM employees");
//
//		while (rs.next()) {
//			String id = rs.getString("id");
//			String firstName = rs.getString("first_name");
//			String lastName = rs.getString("last_name");
//			sb.append("ID: " + id + ", First Name: " + firstName
//					+ ", Last Name: " + lastName + "<br/>");
//		}
//	} catch (Exception ex) {
//		ex.printStackTrace();
//	} finally {
//		try { if (rs != null) rs.close(); } catch (SQLException e) { e.printStackTrace(); }
//		try { if (st != null) st.close(); } catch (SQLException e) { e.printStackTrace(); }
//		try { if (conn != null) conn.close(); } catch (SQLException e) { e.printStackTrace(); }
//	}
//	return sb.toString();
}
